import java.util.Scanner;

public class Training09 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入班级人数：");
        int num = scanner.nextInt();
        double[] score = new double[num];
        for (int i = 0; i < num; i++) {
            System.out.println("请输入第" + (i + 1) + "个学生的成绩：");
            score[i] = scanner.nextDouble();
        }
        double sum = 0;
        for (double s : score) {
            sum += s;
        }
        double avg = sum / num;
        System.out.println("平均成绩为：" + avg);
        int count_80 = 0, count_70 = 0, count_60 = 0, count_fail = 0;
        for (double s : score) {
            if (s > 80) {
                count_80++;
            } else if (s > 70) {
                count_70++;
            } else if (s > 60) {
                count_60++;
            } else {
                count_fail++;
            }
        }
        System.out.println("高于80分的人数为：" + count_80);
        System.out.println("70分以上的人数为：" + count_70);
        System.out.println("60分以上的人数为：" + count_60);
        System.out.println("不及格的人数为：" + count_fail);
    }
}
